{{include template('public/header','admin')}}
<body>
    <div id="page-wrapper">
        <!-- /.row -->
        <div class="row">
            <div class="col-lg-12">
                <div class="alert alert-warning">
                    1：仅当修改了网站域名或者修改了前端URL规则时，请批量更新，未改变时，不需要更新 .<br>
                    2：URL规则设置：系统管理 > 系统设置 > 附加设置 > 前端URL规则.
                </div>
                <table width="100%" cellspacing="0">

                    <form action="/admin/update_urls/change_model" method="post" id="myform">
                        <input type="hidden" name="dosubmit" value="1">
                        <thead height="50" >
                            <tr>
                                <th style="text-align:center;font-size:14px">按照模型更新</th>
                                <th style="text-align:center;font-size:14px">选择栏目范围</th>
                                <th style="font-size:14px" >选择操作内容</th>
                            </tr>
                        </thead>
                        <tbody  height="210">
                            <tr>
                                <td rowspan="2" style="text-align:center">
                                    <select name="modelid" size="2" class="form-control" style="height:200px;width:140px;" onchange="change_model()">
                                        <option value='0' {{if !$modelid }} selected {{/if}}>≡ 所有模型 ≡</option>
                                        {{foreach $modelinfo as $item}}
                                        <option value="{{$item.modelid}}"  {{if $modelid==$item.modelid }} selected {{/if}}> {{$item.name}}</option>
                                        {{/foreach}}
                                    </select>
                                </td>
                                <td rowspan="2" style="text-align:center">
                                    {{$select}}
                                </td>
                                <td style="font-size:14px">更新栏目URL &nbsp;&nbsp;<input type="button" name="dosubmit" value="开始更新" class="btn btn-primary radius" onclick="update_category_url()"></td>
                            </tr>
                            <tr>
                                <td style="font-size:14px">更新内容URL &nbsp;&nbsp;<input type="button" name="dosubmit" value="开始更新" class="btn btn-primary radius" onclick="update_content_url()"><span class="c-red" style="margin-left:10px;font-size:12px">*当内容页有跳转链接时，该URL将会失效</span></td>
                            </tr>
                        </tbody>
                    </form>
                </table>
            </div>
        </div>
    </div>
    <script type="text/javascript">
        function change_model() {
            document.getElementById('myform').submit();
        }

        function update_category_url() {
            document.getElementById('myform').action = '/admin/update_urls/update_category_url';
            document.getElementById('myform').submit();
        }

        function update_content_url() {
            document.getElementById('myform').action = '/admin/update_urls/update_content_url';
            document.getElementById('myform').submit();
        }
    </script>

</body>
</html>
